import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children:[
      {
        path: 'profile',
        name: 'Profile',
        component: () => import('../views/Profile')
      },
      {
        path: 'index',
        name: 'Index',
        component: () => import('../views/Index')
      },
      {
        path: 'hostHome',
        name: 'HostHome',
        component: () => import('../views/HostHome')
      },
      {
        path: 'modifyPassword',
        name: 'ModifyPassword',
        component: () => import('../views/ModifyPassword')
      },
      {
        path: 'hire',
        name: 'HireHouse',
        component: () => import('../views/HireHouse')
      },
      {
        path: 'lease',
        name: 'LeaseHouse',
        component: () => import('../views/LeaseHouse')
      },
      {
        path: 'house',
        name: 'HousePage',
        component: () => import('../views/HousePage')
      },
      {
        path: 'uploadHousePic',
        name: 'UploadHousePic',
        component: () => import('../views/UploadHousePic')
      },
      {
        path: 'updateHousePage',
        name: 'UpdateHousePage',
        component: () => import('../views/UpdateHousePage')
      },
      {
        path: 'orderManage',
        name: 'OrderManage',
        component: () => import('../views/OrderManage')
      }
    ]
  },
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/Register')
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
